<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单管理页面</title>
    <link th:href="@{/css/admin/userManage.css}" rel="stylesheet"/>
</head>
<body>
<th:block th:insert="~{admin/header :: sidebar}"/>
<h1>订单管理</h1>

<div class="navigation-bar">
    <div class="nav-title">订单管理</div>
    <form class="action-bar" action="#" method="get">
        <button class="btn btn-primary action-bar-item" type="submit">立即查询</button>
        <input class="form-control action-bar-item search-input" name="nickname" type="text"
               placeholder="请输入订单编号">
        <input class="form-control action-bar-item search-input" name="number" type="text"
               placeholder="请输入订单状态（0为未支付，1为已完成）">
    </form>
</div>

<!-- 用户列表表格 -->
<table>
    <thead>
    <tr>
        <th>订单号</th>
        <th>用户名</th>
        <th>演唱会名称</th>
        <th>订单状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <!-- 这里可以使用Thymeleaf的循环指令来动态填充用户数据，假设从后端传递过来一个名为users的用户列表对象 -->
    <tr th:each="order : ${orderL.list}">
        <td th:text="${order.orderid}">
        <td th:text="${userMap[order.userid].username}"></td>
        <td th:text="${concertMap[order.concertid].concertname}"></td>
        <td th:switch="${order.orderstatus}">
            <span th:case="0">未支付</span>
            <span th:case="1">已完成</span>
        </td>
        <td>
            <a href="admin/order/editOrder" th:href="@{'editOrder?id=' + ${order.getOrderid()}}">修改订单状态</a>
        </td>
    </tr>
    </tbody>
</table>

<div th:replace="admin/common/console-common :: common_pager(${orderL})"></div>
</body>
</html>